package com.yijiu.response;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.yijiu.network.Response;
import com.yijiu.resource.InvestorList;

/**
 * 请求客户管理信息的响应
 * 
 * @author TangChao
 */
public class RequestInvestorRecordResponse extends Response {

	public List<InvestorList> investorList;

	@Override
	protected void jsonToObject() {
		investorList = new ArrayList<InvestorList>();
		try {
			JSONObject jsonObject = reposonJson.getJSONObject("result");
			JSONArray jsonArray = jsonObject.getJSONArray("infos");
			for (int i = 0; i < jsonArray.length(); i++) {
				InvestorList item = new InvestorList();
				JSONObject object = jsonArray.getJSONObject(i);
				item.userName = object.optString("userName");
				item.realName = object.optString("realName");
				item.userBaseId = object.optString("userBaseId");
				item.distributionQuota = object.optString("distributionQuota");
				investorList.add(item);
			}
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

}
